<template>
  <div>
    <van-nav-bar title="商品订单" left-text="" left-arrow />

    <van-search show-action placeholder="请输入搜索关键词" shape="round">
      <template #action>
        <div>搜索</div>
      </template>
    </van-search>

    <van-tabs v-model="active">
      <van-tab title="全部">
        <All v-if="active == 0" />
      </van-tab>
      <van-tab title="待发货">
        <Delivery v-if="active == 1" />
      </van-tab>
      <van-tab title="待收货">
        <Takedeliery v-if="active == 2" />
      </van-tab>
      <van-tab title="待评价">
        <Evaluate v-if="active == 3" ref="evaluate" />
      </van-tab>
    </van-tabs>
  </div>
</template>

<script>
import All from "../components/All.vue";
import Delivery from "../components/Delivery.vue";
import Takedeliery from "../components/Takedeliery.vue";
import Evaluate from "../components/Evaluate.vue";

export default {
  data() {
    return {
      active: 0,
    };
  },
  components: {
    All,
    Delivery,
    Takedeliery,
    Evaluate,
  },
  created() {
    // console.log("logistic", this.$route.params);
    //
    if (this.$route.params.active !== undefined) {
      this.active = this.$route.params.active;
    }
  },
  methods: {},
};
</script>

<style scoped>
.van-nav-bar {
  background: #00349a;
}
.van-search {
  border-bottom: 1px solid #ccc;
}
</style>